package com.gujia.concurrency.example.immutable;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.gujia.concurrency.annoations.ThreadSafe;

import java.util.Collections;
import java.util.Map;

/**
 * 不可变对象
 */
@ThreadSafe
public class ImmutableExample3 {


    private final static ImmutableList list = ImmutableList.of(1,2,3);
    private final static  ImmutableSet set = ImmutableSet.of(list);
    private   static ImmutableMap map = ImmutableMap.of(1,2,3,4);

    private   static ImmutableMap map1 = ImmutableMap.builder().put(1,2).put(3,4).build();



    public static void main(String[] args) {
        //a =3 ;
        //b="3";
       // map = Maps.newHashMap();
        map.put(1,3);


    }

    public void test(final int a ){
       // a = 2;
    }
}
